package dp;

public class App {

	public static void main(String[] args) {

		CommandeLampe commandeLampe = new CommandeLampe(new Lampe());
		CommandeRadio commandeRadio = new CommandeRadio(new Radio());
		Telecommande tc = new Telecommande();
		
		tc.setCommande(commandeLampe);
		tc.on();
		tc.off();
		System.out.println();
		
		tc.setCommande(commandeRadio);
		tc.on();
		tc.off();
		System.out.println();
		
		CommandeAppareil commandeAppareil = new CommandeAppareil();
		tc.setCommande(commandeAppareil);
		
		Appareil l1 = new Lampe();
		commandeAppareil.setAppareil(l1);
		tc.on();
		tc.off();
		System.out.println();
		
		Appareil r1 = new Radio();
		commandeAppareil.setAppareil(r1);
		tc.on();
		tc.off();
	}
}
